<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
    <title>中肽悦享</title>
    <link rel="stylesheet" href="../css/vant.css">
    <link rel="stylesheet" href="css/topicDetail.css">
</head>

<body>
    <div id="app" v-cloak>

        <div class="topicBox" v-if='topicFlag==1'>
            <div>{{topic.topicTitle}}
            </div>
            <div class="imgBox">
                <img :src="imgUrl + 'zhonghui/topicCoverpic/' + topic.topicContent" alt="" class="conImg">
            </div>
        </div>

        <div v-else class="videoCon">
            <!-- 视频 -->
            <div class="videoBox">
                <div class="overBg" v-if="isShowOver" @click="isShowOver = false">
                    <img :src="imgUrl + 'zhonghui/topic/' + topic.topicCover" />
                    <van-icon name="play-circle-o" class="playIcon" />
                </div>
                <video :src="imgUrl + 'zhonghui/topicCoverpic/' + topic.topicContent" controls autoplay v-else></video>
            </div>
            <div class="navConBox">
                <div class="navCon">
                    <div class="active">简介
                        <div class="line"></div>
                    </div>
                </div>
                <div class="doctorInfo">
                    <div class="leftBox">
                        <span class="videoTit">{{ topic.topicTitle }}</span>
                    </div>
                </div>
            </div>
        </div>

        <div class="downBtn" @click="downHandle">立即下载APP查看</div>


        <div class="loading" v-show="isShow">
            <img src="../img/load.gif">
        </div>
    </div>



    <script src="../js/vue.min.js"></script>
    <script src="../js/flex_ible/lib-flexible.js"></script>
    <script src="../js/vue-lazyload.js"></script>
    <script src="../js/vant.min.js"></script>
    <script src="../js/vue-lazyload.js"></script>
    <script src="../js/url.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/ajax.js"></script>
    <script>

        var ua = navigator.userAgent.toLowerCase();
        var isWeixin = ua.indexOf('micromessenger') != -1;
        Vue.use(VueLazyload);
        var vm = new Vue({
            el: "#app",
            data: {
                imgUrl: 'https://zbz-imgs.oss-cn-beijing.aliyuncs.com/',
                isShow: false,
                topic: '',
                imgList: [],
                isVip: false,
                userType: 0,
                topicFlag: sessionStorage.zhtxFlag,// 1 文章  2 视频
                isShowOver: true,

                topicId: sessionStorage.zhtxId
                // topicFlag: 2,
                // topicId: 2

            },
            created() {
                this.getDetail()
            },
            methods: {

                getDetail() {
                    this.isShow = true
                    var that = this
                    ajax({
                        // url: "https://www.ccclkj.cn:2040/main/topicDetail",
                        url: "http://192.168.0.104:2040/topic/getAppTopicById",
                        type: 'post',
                        data: {
                            topicId: that.topicId
                        },
                        dataType: 'json',
                        timeout: 10000,
                        contentType: "application/json",
                        success: function (res) {
                            var res = JSON.parse(res)
                            if (res.flag) {
                                that.isShow = false
                                that.topic = res.data.topic

                                // that.imgList = res.data.topicContent.split(',')

                                console.log(res);
                            }
                        },
                    })
                },

                downHandle: function () {


                    window.location.replace("downPage.html")
                    // alert('精彩内容，敬请期待')

                    return



                    if (isWeixin) {
                        this.showPop = true
                    } else {
                        if (window.navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
                            console.log("000");
                            var loadDateTime = new Date();
                            window.location = "clinic://"; //schema链接或者universal link
                            window.setTimeout(
                                function () { //如果没有安装app,便会执行setTimeout跳转下载页
                                    var timeOutDateTime = new Date();
                                    if (timeOutDateTime - loadDateTime < 5000) {
                                        window.location =
                                            "https://itunes.apple.com/cn/app/%E5%80%BC%E6%97%A5%E7%94%9F/id1448441059?mt=8"; //ios下载地址  
                                    } else {
                                        window.close();
                                    }
                                }, 500);
                        } else if (window.navigator.userAgent.match(/android/i)) {
                            var state = null;
                            try {
                                window.location = 'clinic://'; //schema链接或者universal link
                                window.setTimeout(
                                    function () {
                                        window.location =
                                            "https://a.app.qq.com/o/simple.jsp?pkgname=com.ccclkj.clinic";
                                        //window.location = "http://www.ccclkj.cn:1125/zbz.apk"; 
                                        //android下载地址  
                                    }, 500);
                            } catch (e) { }
                        }
                    }



                    // window.location.href = ' https://zbz-downlink.oss-cn-zhangjiakou.aliyuncs.com/com.ccclkj.clinic.wgt'
                    // window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9cf9f21ba0cbf62b&redirect_uri=http://www.ccclkj.cn/zhensuo/sys/firstLoginUserAction.action?shop_id=" + ${this.shopId} + "&response_type=code&scope=snsapi_userinfo&state=" + ${this.userId} + "#wechat_redirect`;
                },






            }
        })
    </script>

</body>

</html>